<?php

class ParametreController extends Controller
{
	public $layout='//layouts/column3';
	
	public function __construct()
	{
		if(Yii::app()->user->getState('role') < 4)
			throw new CHttpException(400,'Vous n\'avez pas les droits suffisant pour accéder à la page');
	}
	
	public function actionStatistiques()
	{
		$allBillet = new BILLETINCIDENT;
		$nombreBillet = $allBillet->count();
		$nombreBilletOuvert = $allBillet->count('RESOLU=0');
		
		exit($nombreBilletOuvert);
	}
	

	public function actionParametres() 
	{
		$model = new PERSONNELTECHNIQUE;
		$this->render('/personneltechnique/admin', array('model'=>$model));
		
		$this->layout='//layouts/column4';
		
		$model = new EMETTEUR;
		$this->render('/emetteur/admin', array('model'=>$model));
		
		$model = new TYPELOGICIEL;
		$this->render('/typelogiciel/admin', array('model'=>$model));
		
		$model = new TYPEMATERIEL;
		$this->render('/typemateriel/admin', array('model'=>$model));
		
		$model = new LOGICIEL;
		$this->render('/logiciel/admin', array('model'=>$model));
		
		$model = new MATERIEL;
		$this->render('/materiel/admin', array('model'=>$model));
		
		$model = new POSTE;
		$this->render('/poste/admin', array('model'=>$model));
		
		$model = new PROBLEMELOGICIEL;
		$this->render('/problemelogiciel/admin', array('model'=>$model));
		
		$model = new PROBLEMEMATERIEL;
		$this->render('/problememateriel/admin', array('model'=>$model));
		
		$this->layout='//layouts/column5';
		
		$model = new TYPEINTERVENTION;
		$this->render('/typeintervention/admin', array('model'=>$model));
	}

}